#import <OpenGL/gl.h>
#import <OpenGL/glext.h>
#import <OpenGL/glu.h>
#import <Cocoa/Cocoa.h>
#import "Preview3D.h"

typedef struct {
   GLdouble x,y,z;
} recVec;


@interface BasicOpenGLView : NSOpenGLView
{
  Preview3D* preview_3D;
  NSTimer* timer;
  CFAbsoluteTime time;
  bool damage;
  IBOutlet NSMenuItem * openMenuItem;
}

+ (NSOpenGLPixelFormat*) basicPixelFormat;

- (void) animationTimer:(NSTimer *)timer;
- (void) resizeGL;
- (IBAction) openDocument: (id) sender;
- (id) openDocumentWithContentsOfFile: (NSString*)file_name 
                              display: (BOOL)display;
- (IBAction) saveDocumentAs: (id) sender;
- (BOOL) load_file:(NSString *) file_name;
- (BOOL) save_file:(NSString *) file_name;
- (void) keyDown:(NSEvent *)theEvent;
- (void) mouseDown:(NSEvent *)theEvent;
- (void) rightMouseDown:(NSEvent *)theEvent;
- (void) otherMouseDown:(NSEvent *)theEvent;
- (void) mouseUp:(NSEvent *)theEvent;
- (void) rightMouseUp:(NSEvent *)theEvent;
- (void) otherMouseUp:(NSEvent *)theEvent;
- (void) viewDidMoveToWindow;
- (void) mouseMoved:(NSEvent *)theEvent;
- (void) mouseDragged:(NSEvent *)theEvent;
- (void) scrollWheel:(NSEvent *)theEvent;
- (void) rightMouseDragged:(NSEvent *)theEvent;
- (void) otherMouseDragged:(NSEvent *)theEvent;
- (void) drawRect:(NSRect)rect;

- (void) prepareOpenGL;
- (void) update;		// moved or resized

- (BOOL) acceptsFirstResponder;
- (BOOL) becomeFirstResponder;
- (BOOL) resignFirstResponder;

- (id) initWithFrame: (NSRect) frameRect;
- (void) awakeFromNib;

@end
